package com.example.guavaSrudy.BasicEvent.better;

import com.google.common.collect.Lists;
import com.google.common.eventbus.EventBus;
import com.google.common.eventbus.Subscribe;
import lombok.Data;

import java.util.List;

@Data
public class TradeSellAuditor {

    private List<SellEvent> sellEvents = Lists.newArrayList();


    public TradeSellAuditor(EventBus eventBus) {
        eventBus.register(this);
    }
    @Subscribe
    public void auditSell(SellEvent sellEvent) {
        sellEvents.add(sellEvent);
        System.out.println("Receive SellEvent" + sellEvent);
    }

}
